<template>
    <div class="home">
        <!-- <img alt="Vue logo" src="../assets/logo.png" />
        <HelloWorld msg="Welcome to Your Vue.js App" /> -->
        <div class="screen_1">
            <div class="bg_box">
                <div class="bg_item" v-show="show_bg==1">
                    <img class="bg_item_img" src="@/assets/imgs/resume_slide1.jpg" alt="">
                </div>
                <div class="bg_item" v-show="show_bg==2">
                    <img class="bg_item_img" src="@/assets/imgs/resume_slide2.jpg" alt="">
                </div>
                <div class="bg_item" v-show="show_bg==3">
                    <img class="bg_item_img" src="@/assets/imgs/resume_slide3.jpg" alt="">
                </div>
            </div>
            <div class="content">
                <!-- <h1>Hello I am ChenJiaxin</h1>
                <h3>一名前端工程师</h3>
                <h5>学习是一件充实而又愉快的过程，期待新鲜事物既前端即兴趣</h5> -->
                <img class="avater" src="@/assets/imgs/head.jpg" alt="">
                <p class="title_1">Hello I am ChenJiaxin</p>
                <p class="title_2">一名前端工程师</p>
                <p class="title_3">学习是一件充实而又愉快的过程，期待新鲜事物既前端即兴趣</p>
            </div>
        </div>
    </div>
</template>

<script>
// @ is an alias to /src

export default {
    name: "Home",
    data () {
        return {
            show_bg: 1,//显示背景图 序号
            time_id: ""
        }
    },
    created () {

    },
    mounted () {
        this.time_id = setInterval(() => {
            this.show_bg++;
            this.show_bg = this.show_bg > 3 ? 1 :  this.show_bg;
        }, 12000);
    },
    destroyed () {

    },
    methods: {

    }
};
</script>

<style lang="less" scoped>
.home {
    .screen_1 {
        width: 100%;
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        p {
            text-align: center;
            color: #ffffff;
        }
        .bg_box {
            width: 100%;
            height: 100vh;
            position: absolute;
            top: 0;
            left: 0;
            z-index: -1;
            .bg_item {
                width: 100%;
                height: 100%;
                // transform: scale(1);
                overflow: hidden;
                
                .bg_item_img {
                    width: 100%;
                    height: 100%;
                    vertical-align: top;
                    object-fit: cover;
                    animation: bgScale 4s infinite alternate;
                    @keyframes bgScale {
                    from {
                        transform: scale(1);
                    }
                    to {
                        transform: scale(1.2);
                    }
                }
                }
                
            }
        }
        .content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            
            .avater {
                width: 3rem;
                height: 3rem;
                border-radius: 50%;
                margin-bottom: 0.5rem;
            }
        }
        .title_1 {
            font-size: 0.6rem;
        }
        .title_2 {
            font-size: 0.5rem;
            margin: 0.5rem 0;
        }
        .title_3 {
            font-size: 0.4rem;
            max-width: 6rem;
        }
    }
}
</style>
